package org.zoomdev.zoom.dao.adapters.parameter;

import org.zoomdev.zoom.dao.adapters.ParameterAdapter;

import java.math.BigInteger;
import java.sql.PreparedStatement;
import java.sql.SQLException;

// 大整数适配器
public class BigIntegerParameterAdapter implements ParameterAdapter<BigInteger> {

    @Override
    public void setNonnullParameter(PreparedStatement ps, int index, BigInteger data) throws SQLException {
        // 转换为字符串处理，避免数值越界问题
        ps.setString(index, data.toString());
    }
}
